import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserCardSettingVO, UserCardSettingForm, UserCardSettingQuery } from '@/api/goods/userCardSetting/types';

/**
 * 查询用户名片设置列表
 * @param query
 * @returns {*}
 */

export const listUserCardSetting = (query?: UserCardSettingQuery): AxiosPromise<UserCardSettingVO[]> => {
    return request({
        url: '/system/userCardSetting/list',
        method: 'get',
        params: query
    });
};

/**
 * 查询用户名片设置详细
 * @param id
 */
export const getUserCardSetting = (id: string | number): AxiosPromise<UserCardSettingVO> => {
    return request({
        url: '/system/userCardSetting/' + id,
        method: 'get'
    });
};

/**
 * 新增用户名片设置
 * @param data
 */
export const addUserCardSetting = (data: UserCardSettingForm) => {
    return request({
        url: '/system/userCardSetting',
        method: 'post',
        data: data
    });
};

/**
 * 修改用户名片设置
 * @param data
 */
export const updateUserCardSetting = (data: UserCardSettingForm) => {
    return request({
        url: '/system/userCardSetting',
        method: 'put',
        data: data
    });
};

/**
 * 删除用户名片设置
 * @param id
 */
export const delUserCardSetting = (id: string | number | Array<string | number>) => {
    return request({
        url: '/system/userCardSetting/' + id,
        method: 'delete'
    });
};